<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width,initial-scale=1.0,user-scalable=no">
<title></title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"
	type="text/javascript"></script>
</head>
<body>
	<div class="upload">
		<p>上传原始图片</p>
		<form id="uploadForm" enctype="multipart/form-data" method="post">
			<p>
				uid： <input type="text" name="uid" value="" />
			</p>
			<p>
				organization_id： <input type="text" name="organization_id" value="" />
			</p>
			<input type="file" name="myfiles" id="myfiles" /> <input
				type="button" value="上传" onclick="doUploadImg()" />
		</form>
	</div>
	<div class="upload">
		<p>上传人脸识别登录的图片</p>
		<form id="uploadForm2" enctype="multipart/form-data" method="post">
			<p>
				organization_id： <input type="text" name="organization_id" value="" />
			</p>
			<input type="file" name="myfiles" id="myfiles" /> <input
				type="button" value="上传" onclick="doUpload()" />
		</form>
	</div>
</body>

<script type="text/javascript">
	//原始照片上传
	function doUploadImg() {
		var formData = new FormData($("#uploadForm")[0]);
		$.ajax({
			url : 'http://127.0.0.1:8001/m-server/api/tools/upload',
			type : 'POST',
			data : formData,
			async : false,
			cache : false,
			contentType : false,
			processData : false,
			success : function(returndata) {
				console.log(returndata);
				alert("上传成功");
			},
			error : function(returndata) {
				console.log(returndata);
			}
		});
	}
	//识别照片上传
	function doUpload() {
		var formData = new FormData($("#uploadForm2")[0]);
		$.ajax({
			url : 'http://127.0.0.1:8001/sign-server/api/auth/faceSign',
			type : 'POST',
			data : formData,
			async : false,
			cache : false,
			contentType : false,
			processData : false,
			success : function(returndata) {
				console.log(returndata);
			},
			error : function(returndata) {
				console.log(returndata);
			}
		});
	}
</script>
</html>